<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('信息管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>招聘岗位：</label>
                            <input type="text" name="recruitmentName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:recMes:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:recMes:remove')}]];
    var prefix = ctx + "system/recMes";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "信息管理",
            columns: [{
                checkbox: true
            },
                {
                    field: 'recResId',
                    title: '招聘-简历id',
                    visible: false
                },
                {
                    field: 'recruitmentId',
                    title: '招聘信息id',
                    visible: false
                },
                {
                    field: 'resumeId',
                    title: '简历信息id',
                    visible: false
                },
                {
                    field: 'recruitmentName',
                    title: '招聘岗位名'
                },
                {
                    field: 'resumeName',
                    title: '应聘者姓名'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success" href="javascript:void(0)" onclick="detail(\'' + row.resumeId + '\')"><i></i>详情</a> ');
                        actions.push('<a class="btn btn-danger" href="javascript:void(0)" onclick="interview(\'' + row.recResId + '\')"><i></i>发送邀请</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    //查询用户详细信息
    function detail (recResId) {
        $.modal.open('简历详情', prefix + '/detail/' + recResId, '900', '600');
    }

    //发布面试邀请
    function interview(recResId) {
        var request = {
            url: prefix + "/interview",
            type: "post",
            dataType: "json",
            data: {
                "recResId":recResId
            },
            success: function (result) {
            }
        };
        $.ajax(request);
    }
</script>
</body>
</html>
